Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pub/Sub auto-decompression #45

Merged
merged 9 commits into from
Dec 20, 2023
Merged

Conversation

merklefruit
Copy link
Contributor

@merklefruit merklefruit commented Dec 18, 2023

Overview

  • Added one CompressionType byte in pub/sub message headers, which enables the sub socket to decompress each message individually. More compression types can be added in the future by just extending this enum.
  • Added a new PubOption: min_compress_size to set a payload size threshold under which to skip compression.

In practice, it is no longer necessary to specify a Decompressor when creating a SubSocket. This also solves the issue in #41 where the sub socket might have expected a specific compression type from different publishers.

Benchmarks

Results are not clear yet, the existing pubsub bench didn't show any big difference, which is expected.
Probably a before / after profiler run will be useful here (yet todo).


@merklefruit merklefruit added C-feature Category: Feature A-socket Area: Sockets A-wire Area: Wire protocol A-compression Area: Compression labels Dec 18, 2023
@merklefruit merklefruit self-assigned this Dec 18, 2023
Copy link
Contributor

@mempirate mempirate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFGTM

msg-socket/src/pub/mod.rs Outdated Show resolved Hide resolved
@merklefruit merklefruit merged commit b282179 into main Dec 20, 2023
8 checks passed
@merklefruit merklefruit deleted the feat/header-compression-type branch December 20, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compression Area: Compression A-socket Area: Sockets A-wire Area: Wire protocol C-feature Category: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Pub/Sub Compression type in message Headers SubSocket: specify decompressor on a connection level
2 participants